package model.lights;

public class ContextFallOff {
    private FallOffStrategy falloff;
 
    public ContextFallOff(int mode) {
        if (mode == 0) {
        	LinearFallOff();
        } else {
        	QuadFallOff();
        }
    }
 
    public void QuadFallOff() {
        falloff = new QuadFallOff();
    }
 
    public void LinearFallOff() {
        falloff = new LinearFallOff();
    }
 
    public void changeFallOff(int mode) {
    	if (mode == 0) {
        	LinearFallOff();
        } else {
        	QuadFallOff();
        }
    }
    
    public double getIntensityByDistance(double distance) {
        return falloff.executeFallOff(distance);
    }
}
